using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace ProtectThePieWP7.AdditionalClasses
{
    static class AddString
    {
        public static void DrawStringWithShadow(SpriteBatch spriteBatch, string text, Vector2 position, SpriteFont textFont, Color textColor, Color shadowColor)
        {
            spriteBatch.DrawString(textFont, text, new Vector2(position.X + 2, position.Y + 2), shadowColor);
            spriteBatch.DrawString(textFont, text, position, textColor);
        }

        public static void DrawStringWithShadow(SpriteBatch spriteBatch, string text, Vector2 position, Vector2 origin, SpriteFont textFont, Color textColor, Color shadowColor)
        {
            spriteBatch.DrawString(textFont, text, new Vector2(position.X + 2, position.Y + 2), shadowColor, 0.0f, origin, 1.0f, SpriteEffects.None, 1);
            spriteBatch.DrawString(textFont, text, position, textColor, 0.0f, origin, 1.0f, SpriteEffects.None, 1);
        }

        public static Vector2 GetStringOrigin(string text, SpriteFont textFont)
        {
            Vector2 textSize = textFont.MeasureString(text);
            return new Vector2(textSize.X / 2, textSize.Y / 2);
        }

    }
}
